package qq.listener;

import catcode.CatCodeUtil;
import love.forte.common.ioc.annotation.Beans;
import love.forte.simbot.annotation.OnGroup;
import love.forte.simbot.api.message.events.GroupMsg;
import love.forte.simbot.api.sender.MsgSender;
import qq.tool.OwnerTool;
import qq.utils.RecentMessageUtil;

@Beans
public class OwnerListener {
    @OnGroup
    public void groupMsg(GroupMsg groupMsg, MsgSender sender){
        long id = Long.parseLong(groupMsg.toString().split("=")[5].split(",")[0]);
        String message = groupMsg.getMsg();
        if(id==1030699086L){
            if (message.equals("管理员命令")){
                sender.SENDER.sendGroupMsg(groupMsg,"1、开启打劫\n" +
                        "2、关闭打劫\n" +
                        "3、开启图片\n" +
                        "4、关闭图片");
                return;
            }
            if (message.equals("关闭打劫")){
                OwnerTool.dajieStatus=false;
                sender.SENDER.sendGroupMsg(groupMsg,"已关闭打劫功能");
                return;
            }
            if (message.equals("开启打劫")){
                OwnerTool.dajieStatus=true;
                sender.SENDER.sendGroupMsg(groupMsg,"已启动打劫功能");
                return;
            }
            if (message.equals("开启图片")){
                OwnerTool.setuStatus = true;
                sender.SENDER.sendGroupMsg(groupMsg,"已启动图片功能");
                return;
            }
            if (message.equals("关闭图片")){
                OwnerTool.setuStatus = false;
                sender.SENDER.sendGroupMsg(groupMsg,"已关闭图片功能");
                return;
            }
            if (message.equals("关闭骂人")){
                RecentMessageUtil.maRen = false;

                return;
            }
            if(message.equals("开启骂人")){
                RecentMessageUtil.maRen = true;
                return;
            }
        }
    }
}
